﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <div id="js-console"></div>
    <script src="../scripts/js-console.js"></script>
    <script>
        String.prototype.htmlEscape = function () {
            var escapedStr = String(this).replace(/&/g, '&amp;');
            escapedStr = escapedStr.replace(/</g, '&lt;');
            escapedStr = escapedStr.replace(/>/g, '&gt;');
            escapedStr = escapedStr.replace(/"/g, '&quot;');
            escapedStr = escapedStr.replace(/'/g, "&#39");
            return escapedStr;
        }

        var url = "<p>Please visit <a href='http://academy.telerik.com'>our site</a> to choose a training course. Also visit <a href='www.devbg.org'>our forum</a> to discuss the courses.</p>";
        var urlToString = url.toString();

        urlToString = urlToString.replace(/<a href='/g, '[URL=');
        urlToString = urlToString.replace(/<\/a>/g, '[/URL]');
        var res = urlToString.htmlEscape();
        res = res.replace(/&#39/g, '');
        jsConsole.writeLine(res);
    </script>
</body>
</html>